package top.lingchen.blogapi.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.lingchen.blogapi.service.SysUserService;
import top.lingchen.blogapi.vo.Result;

/**
 * @Author 凌宸
 * @create 2021-12-16 下午 6:02
 * @Description
 * @Version 1.0
 */
@RestController
@RequestMapping("/users")
public class usersController {
    @Autowired
    private SysUserService sysUserService;

    @GetMapping("/currentUser")
    public Result currentUser(@RequestHeader("Authorization") String token){
        return sysUserService.findUserByToken(token);
    }
}
